home *** CD-ROM | disk | FTP | other *** search
GNU Info File | 1998-05-21 | 21.1 KB | 587 lines |
- This is Info file ../info/xemacs-faq.info, produced by Makeinfo version
- 1.68 from the input file xemacs-faq.texi.
-
- File: xemacs-faq.info, Node: Q5.1.7, Next: Q5.1.8, Prev: Q5.1.6, Up: Miscellaneous
-
- I like the the `do' form of cl, does it slow things down?
- =========================================================
-
- It shouldn't. Here is what Dave Gillespie has to say about cl.el
- performance:
-
- Many of the advanced features of this package, such as `defun*',
- `loop', and `setf', are implemented as Lisp macros. In
- byte-compiled code, these complex notations will be expanded into
- equivalent Lisp code which is simple and efficient. For example,
- the forms
-
- (incf i n)
- (push x (car p))
-
- are expanded at compile-time to the Lisp forms
-
- (setq i (+ i n))
- (setcar p (cons x (car p)))
-
- which are the most efficient ways of doing these respective
- operations in Lisp. Thus, there is no performance penalty for
- using the more readable `incf' and `push' forms in your compiled
- code.
-
- *Interpreted* code, on the other hand, must expand these macros
- every time they are executed. For this reason it is strongly
- recommended that code making heavy use of macros be compiled. (The
- features labelled "Special Form" instead of "Function" in this
- manual are macros.) A loop using `incf' a hundred times will
- execute considerably faster if compiled, and will also
- garbage-collect less because the macro expansion will not have to
- be generated, used, and thrown away a hundred times.
-
- You can find out how a macro expands by using the `cl-prettyexpand'
- function.
-
- File: xemacs-faq.info, Node: Q5.1.8, Next: Q5.1.9, Prev: Q5.1.7, Up: Miscellaneous
-
- I like recursion, does it slow things down?
- ===========================================
-
- Yes. Emacs byte-compiler cannot do much to optimize recursion. But
- think well whether this is a real concern in Emacs. Much of the Emacs
- slowness comes from internal mechanisms such as redisplay, or from the
- fact that it is an interpreter.
-
- Please try not to make your code much uglier to gain a very small
- speed gain. It's not usually worth it.
-
- File: xemacs-faq.info, Node: Q5.1.9, Next: Q5.1.10, Prev: Q5.1.8, Up: Miscellaneous
-
- How do I put a glyph as annotation in a buffer?
- ===============================================
-
- Here is a solution that will insert the glyph annotation at the
- beginning of buffer:
-
- (make-annotation (make-glyph '([FORMAT :file FILE]
- [string :data "fallback-text"]))
- (point-min)
- 'text
- (current-buffer))
-
- Replace `FORMAT' with an unquoted symbol representing the format of
- the image (e.g. `xpm', `xbm', `gif', `jpeg', etc.) Instead of `FILE',
- use the image file name (e.g.
- `/usr/local/lib/xemacs-20.2/etc/recycle.xpm').
-
- You can turn this to a function (that optionally prompts you for a
- file name), and inserts the glyph at `(point)' instead of `(point-min)'.
-
- File: xemacs-faq.info, Node: Q5.1.10, Next: Q5.2.1, Prev: Q5.1.9, Up: Miscellaneous
-
- `map-extents' won't traverse all of my extents!
- ===============================================
-
- I tried to use `map-extents' to do an operation on all the extents
- in a region. However, it seems to quit after processing a random number
- of extents. Is it buggy?
-
- No. The documentation of `map-extents' states that it will iterate
- across the extents as long as FUNCTION returns `nil'. Unexperienced
- programmers often forget to return `nil' explicitly, which results in
- buggy code. For instance, the following code is supposed to delete all
- the extents in a buffer, and issue as many `fubar!' messages.
-
- (map-extents (lambda (ext ignore)
- (delete-extent ext)
- (message "fubar!")))
-
- Instead, it will delete only the first extent, and stop right there -
- because `message' will return a non-nil value. The correct code is:
-
- (map-extents (lambda (ext ignore)
- (delete-extent ext)
- (message "fubar!")
- nil))
-
- File: xemacs-faq.info, Node: Q5.2.1, Next: Q5.2.2, Prev: Q5.1.10, Up: Miscellaneous
-
- How do I turn off the sound?
- ============================
-
- Add the following line to your `.emacs':
-
- (setq bell-volume 0)
- (setq sound-alist nil)
-
- That will make your XEmacs totally silent - even the default ding
- sound (TTY beep on TTY-s) will be gone.
-
- File: xemacs-faq.info, Node: Q5.2.2, Next: Q5.2.3, Prev: Q5.2.1, Up: Miscellaneous
-
- How do I get funky sounds instead of a boring beep?
- ===================================================
-
- Make sure your XEmacs was compiled with sound support, and then put
- this in your `.emacs':
-
- (load-default-sounds)
-
- The sound support in XEmacs 19.14 was greatly improved over previous
- versions.
-
- File: xemacs-faq.info, Node: Q5.2.3, Next: Q5.2.4, Prev: Q5.2.2, Up: Miscellaneous
-
- What's NAS, how do I get it?
- ============================
-
- *Note Q2.0.3:: for an explanation of the "Network Audio System".
-
- File: xemacs-faq.info, Node: Q5.2.4, Next: Q5.3.1, Prev: Q5.2.3, Up: Miscellaneous
-
- Sunsite sounds don't play.
- ==========================
-
- I'm having some trouble with sounds I've downloaded from sunsite.
- They play when I run them through `showaudio' or cat them directly to
- `/dev/audio', but XEmacs refuses to play them.
-
- Markus Gutschke <gutschk@uni-muenster.de> writes:
-
- [Many of] These files have an (erroneous) 24byte header that tells
- about the format that they have been recorded in. If you cat them
- to `/dev/audio', the header will be ignored and the default
- behavior for /dev/audio will be used. This happens to be 8kHz
- uLaw. It is probably possible to fix the header by piping through
- `sox' and passing explicit parameters for specifying the sampling
- format; you then need to perform a 'null' conversion from SunAudio
- to SunAudio.
-
- File: xemacs-faq.info, Node: Q5.3.1, Next: Q5.3.2, Prev: Q5.2.4, Up: Miscellaneous
-
- How do you make XEmacs indent CL if-clauses correctly?
- ======================================================
-
- I'd like XEmacs to indent all the clauses of a Common Lisp `if' the
- same amount instead of indenting the 3rd clause differently from the
- first two.
-
- One way is to add, to `.emacs':
-
- (put 'if 'lisp-indent-function nil)
-
- However, note that the package `cl-indent.el' that comes with XEmacs
- sets up this kind of indentation by default. `cl-indent' also knows
- about many other CL-specific forms. To use `cl-indent', one can do
- this:
-
- (load "cl-indent")
- (setq lisp-indent-function (function common-lisp-indent-function))
-
- One can also customize `cl-indent.el' so it mimics the default `if'
- indentation `then' indented more than the `else'. Here's how:
-
- (put 'if 'common-lisp-indent-function '(nil nil &body))
-
- Also, a new version (1.2) of `cl-indent.el' was posted to
- comp.emacs.xemacs on 12/9/94. This version includes more documentation
- than previous versions. This may prove useful if you need to customize
- any indent-functions.
-
- File: xemacs-faq.info, Node: Q5.3.2, Next: Q5.3.3, Prev: Q5.3.1, Up: Miscellaneous
-
- Fontifying hang when editing a postscript file.
- ===============================================
-
- When I try to edit a postscript file it gets stuck saying:
- `fontifying 'filename' (regexps....)' and it just sits there. If I
- press `C-c' in the window where XEmacs was started, it suddenly becomes
- alive again.
-
- This was caused by a bug in the Postscript font-lock regular
- expressions. It was fixed in 19.13. For earlier versions of XEmacs,
- have a look at your `.emacs' file. You will probably have a line like:
-
- (add-hook 'postscript-mode-hook 'turn-on-font-lock)
-
- Take it out, restart XEmacs, and it won't try to fontify your
- postscript files anymore.
-
- File: xemacs-faq.info, Node: Q5.3.3, Next: Q5.3.4, Prev: Q5.3.2, Up: Miscellaneous
-
- How can I print WYSIWYG a font-locked buffer?
- =============================================
-
- Font-lock looks nice. How can I print (WYSIWYG) the highlighted
- document?
-
- The package `ps-print.el', which is now included with XEmacs,
- provides the ability to do this. The source code contains complete
- instructions on its use, in
- `<xemacs_src_root>/lisp/packages/ps-print.el'.
-
- File: xemacs-faq.info, Node: Q5.3.4, Next: Q5.3.5, Prev: Q5.3.3, Up: Miscellaneous
-
- Getting `M-x lpr' to work with postscript printer.
- ==================================================
-
- My printer is a Postscript printer and `lpr' only works for
- Postscript files, so how do I get `M-x lpr-region' and `M-x lpr-buffer'
- to work?
-
- Put something like this in your `.emacs':
-
- (setq lpr-command "a2ps")
- (setq lpr-switches '("-p" "-1"))
-
- If you don't use a2ps to convert ASCII to postscript (why not, it's
- free?), replace with the command you do use. Note also that some
- versions of a2ps require a `-Pprinter' to ensure spooling.
-
- File: xemacs-faq.info, Node: Q5.3.5, Next: Q5.3.6, Prev: Q5.3.4, Up: Miscellaneous
-
- How do I specify the paths that XEmacs uses for finding files?
- ==============================================================
-
- You can specify what paths to use by using a number of different
- flags when running configure. See the section MAKE VARIABLES in the
- top-level file INSTALL in the XEmacs distribution for a listing of
- those flags.
-
- Most of the time, however, the simplest fix is: *do not* specify
- paths as you might for GNU Emacs. XEmacs can generally determine the
- necessary paths dynamically at run time. The only path that generally
- needs to be specified is the root directory to install into. That can
- be specified by passing the `--prefix' flag to configure. For a
- description of the XEmacs install tree, please consult the `NEWS' file.
-
- File: xemacs-faq.info, Node: Q5.3.6, Next: Q5.3.7, Prev: Q5.3.5, Up: Miscellaneous
-
- [This question intentionally left blank]
- ========================================
-
- Obsolete question, left blank to avoid renumbering.
-
- File: xemacs-faq.info, Node: Q5.3.7, Next: Q5.3.8, Prev: Q5.3.6, Up: Miscellaneous
-
- Can I have the end of the buffer delimited in some way?
- =======================================================
-
- Say, with: `[END]'?
-
- Try this:
-
- (let ((ext (make-extent (point-min) (point-max))))
- (set-extent-property ext 'start-closed t)
- (set-extent-property ext 'end-closed t)
- (set-extent-property ext 'detachable nil)
- (set-extent-end-glyph ext (make-glyph [string :data "[END]"])))
-
- Since this is XEmacs, you can specify an icon to be shown on
- window-system devices. To do so, change the `make-glyph' call to
- something like this:
-
- (make-glyph '([xpm :file "~/something.xpm"]
- [string :data "[END]"]))
-
- You can inline the XPM definition yourself by specifying `:data'
- instead of `:file'. Here is such a full-featured version that works on
- both X and TTY devices:
-
- (let ((ext (make-extent (point-min) (point-max))))
- (set-extent-property ext 'start-closed t)
- (set-extent-property ext 'end-closed t)
- (set-extent-property ext 'detachable nil)
- (set-extent-end-glyph ext (make-glyph '([xpm :data "\
- /* XPM */
- static char* eye = {
- \"20 11 7 2\",
- \"__ c None\"
- \"_` c #7f7f7f\",
- \"_a c #fefefe\",
- \"_b c #7f0000\",
- \"_c c #fefe00\",
- \"_d c #fe0000\",
- \"_e c #bfbfbf\",
- \"___________`_`_`___b_b_b_b_________`____\",
- \"_________`_`_`___b_c_c_c_b_b____________\",
- \"_____`_`_`_e___b_b_c_c_c___b___b_______`\",
- \"___`_`_e_a___b_b_d___b___b___b___b______\",
- \"_`_`_e_a_e___b_b_d_b___b___b___b___b____\",
- \"_`_`_a_e_a___b_b_d___b___b___b___b___b__\",
- \"_`_`_e_a_e___b_b_d_b___b___b___b___b_b__\",
- \"___`_`_e_a___b_b_b_d_c___b___b___d_b____\",
- \"_____`_`_e_e___b_b_b_d_c___b_b_d_b______\",
- \"_`_____`_`_`_`___b_b_b_d_d_d_d_b________\",
- \"___`_____`_`_`_`___b_b_b_b_b_b__________\",
- } ;"]
- [string :data "[END]"]))))
-
- Note that you might want to make this a function, and put it to a
- hook. We leave that as an excercise for the reader.
-
- File: xemacs-faq.info, Node: Q5.3.8, Next: Q5.3.9, Prev: Q5.3.7, Up: Miscellaneous
-
- How do I insert today's date into a buffer?
- ===========================================
-
- Like this:
-
- (insert (current-time-string))
-
- File: xemacs-faq.info, Node: Q5.3.9, Next: Q5.3.10, Prev: Q5.3.8, Up: Miscellaneous
-
- Are only certain syntactic character classes available for abbrevs?
- ===================================================================
-
- Markus Gutschke <gutschk@uni-muenster.de> writes:
-
- Yes, abbrevs only expands word-syntax strings. While XEmacs does
- not prevent you from defining (e.g. with `C-x a g' or `C-x a l')
- abbrevs that contain special characters, it will refuse to expand
- them. So you need to ensure, that the abbreviation contains
- letters and digits only. This means that `xd', `d5', and `5d' are
- valid abbrevs, but `&d', and `x d' are not.
-
- If this sounds confusing to you, (re-)read the online
- documentation for abbrevs (`C-h i m XEmacs RET m Abbrevs RET'),
- and then come back and read this question/answer again.
-
- Newsflash: this restriction has been lifted, starting with XEmacs
- 20.3, which is currently in beta. Hrvoje Niksic <hniksic@srce.hr> will
- appreciate it if you download a beta, try out whether abbreviations work
- like you expect them to, and let him know.
-
- File: xemacs-faq.info, Node: Q5.3.10, Next: Q5.3.11, Prev: Q5.3.9, Up: Miscellaneous
-
- How can I get those oh-so-neat X-Face lines?
- ============================================
-
- Firstly there is an ftp site which describes X-faces and has the
- associated tools mentioned below, at
- <URL:ftp://ftp.cs.indiana.edu:/pub/faces/>.
-
- Then the steps are
-
- 1. Create 48x48x1 bitmap with your favorite tool
-
- 2. Convert to "icon" format using one of xbm2ikon, pbmtoicon, etc.,
- and then compile the face.
-
- 3. cat file.xbm | xbm2ikon |compface > file.face
-
- 4. Then be sure to quote things that are necessary for emacs strings:
-
- cat ./file.face | sed 's/\\/\\\\/g' | sed 's/\"/\\\"/g' > ./file.face.quoted
-
- 5. Then set up emacs to include the file as a mail header - there
- were a couple of suggestions here--either something like:
-
- (setq mail-default-headers
- "X-Face: <Ugly looking text string here>")
-
- Or, alternatively, as:
-
- (defun mail-insert-x-face ()
- (save-excursion
- (goto-char (point-min))
- (search-forward mail-header-separator)
- (beginning-of-line)
- (insert "X-Face:")
- (insert-file-contents "~/.face")))
-
- (add-hook 'mail-setup-hook 'mail-insert-x-face)
-
- However, 2 things might be wrong:
-
- Some versions of pbmtoicon produces some header lines that is not
- expected by the version of compface that I grabbed. So I found I had to
- include a `tail +3' in the pipeline like this:
-
- cat file.xbm | xbm2ikon | tail +3 |compface > file.face
-
- Some people have also found that if one uses the `(insert-file)'
- method, one should NOT quote the face string using the sed script .
-
- It might also be helpful to use Stig's <stig@hackvan.com> script
- (included in the compface distribution at XEmacs.org) to do the
- conversion. For convenience xbm2xface is available for anonymous FTP at
- <URL:ftp://ftp.miranova.com/pub/xemacs/xbm2xface.pl>.
-
- Contributors for this item:
-
- Paul Emsley, Ricardo Marek, Amir J. Katz, Glen McCort, Heinz Uphoff,
- Peter Arius, Paul Harrison, and Vegard Vesterheim
-
- File: xemacs-faq.info, Node: Q5.3.11, Next: Q5.3.12, Prev: Q5.3.10, Up: Miscellaneous
-
- How do I add new Info directories?
- ==================================
-
- You use something like:
-
- (setq Info-directory-list (cons
- (expand-file-name "~/info")
- Info-default-directory-list))
-
- David Masterson <davidm@prism.kla.com> writes:
-
- Emacs Info and XEmacs Info do many things differently. If you're
- trying to support a number of versions of Emacs, here are some
- notes to remember:
-
- 1. Emacs Info scans `Info-directory-list' from right-to-left
- while XEmacs Info reads it from left-to-right, so append to
- the *correct* end of the list.
-
- 2. Use `Info-default-directory-list' to initialize
- `Info-directory-list' *if* it is available at startup, but not
- all Emacsen define it.
-
- 3. Emacs Info looks for a standard `dir' file in each of the
- directories scanned from #1 and magically concatenates them
- together.
-
- 4. XEmacs Info looks for a `localdir' file (which consists of
- just the menu entries from a `dir' file) in each of the
- directories scanned from #1 (except the first), does a simple
- concatentation of them, and magically attaches the resulting
- list to the end of the menu in the `dir' file in the first
- directory.
-
- Another alternative is to convert the documentation to HTML with
- texi2html and read it from a web browser like Lynx or W3.
-
- File: xemacs-faq.info, Node: Q5.3.12, Prev: Q5.3.11, Up: Miscellaneous
-
- What do I need to change to make printing work?
- ===============================================
-
- For regular printing there are two variables that can be customized.
-
- `lpr-command'
- This should be set to a command that takes standard input and sends
- it to a printer. Something like:
-
- (setq lpr-command "lp")
-
- `lpr-switches'
- This should be set to a list that contains whatever the print
- command requires to do its job. Something like:
-
- (setq lpr-switches '("-depson"))
-
- For postscript printing there are three analogous variables to
- customize.
-
- `ps-lpr-command'
- This should be set to a command that takes postscript on standard
- input and directs it to a postscript printer.
-
- `ps-lpr-switches'
- This should be set to a list of switches required for
- `ps-lpr-command' to do its job.
-
- `ps-print-color-p'
- This boolean variable should be set `t' if printing will be done in
- color, otherwise it should be set to `nil'.
-
- NOTE: It is an undocumented limitation in XEmacs that postscript
- printing (the `Pretty Print Buffer' menu item) *requires* a window
- system environment. It cannot be used outside of X11.
-
- File: xemacs-faq.info, Node: Current Events, Prev: Miscellaneous, Up: Top
-
- What the Future Holds
- *********************
-
- This is part 6 of the XEmacs Frequently Asked Questions list. This
- section will change monthly, and contains any interesting items that
- have transpired over the previous month. If you are reading this from
- the XEmacs distribution, please see the version on the Web or archived
- at the various FAQ FTP sites, as this file is surely out of date.
-
- * Menu:
-
- * Q6.0.1:: What is new in 20.2?
- * Q6.0.2:: What is new in 20.3?
- * Q6.0.3:: Procedural changes in XEmacs development.
-
- File: xemacs-faq.info, Node: Q6.0.1, Next: Q6.0.2, Prev: Current Events, Up: Current Events
-
- What is new in 20.2?
- ====================
-
- The biggest changes in 20.2 include intergration of EFS (the next
- generation of ange-ftp) and AUC Tex (the Emacs subsystem that includes a
- major mode for editing Tex and LaTeX, and a lot of other stuff). Many
- bugs from 20.0 have been fixed for this release. 20.2 also contains a
- new system for customizing XEmacs options, invoked via `M-x customize'.
-
- XEmacs 20.2 is the development release (20.0 was beta), and is no
- longer considered unstable.
-
- File: xemacs-faq.info, Node: Q6.0.2, Next: Q6.0.3, Prev: Q6.0.1, Up: Current Events
-
- What is new in 20.3?
- ====================
-
- XEmacs 20.3 will be released in November 1997. It will contain many
- bugfixes, and a number of new features, including Autoconf 2 based
- configuration, multiple TTY frames, further customizations, synches with
- GNU Emacs 20, advanced Perl-like regexp features, and more.
-
- XEmacs 20.3 will be the first non-beta v20 release, and will be the
- basis for all further development.
-
- File: xemacs-faq.info, Node: Q6.0.3, Prev: Q6.0.2, Up: Current Events
-
- Procedural changes in XEmacs development.
- =========================================
-
- 1. Discussion about the development of XEmacs occurs on the
- xemacs-beta mailing list. Subscriptions to this list will now be
- fully automated instead of being handled by hand. Send a mail
- message to <xemacs-beta-request@xemacs.org> with a subject of
- subscribe to join the list. Please note this is a developers
- mailing list for people who have an active interest in the
- development process.
-
- The discussion of NT XEmacs development is taking place on a
- separate mailing list. Send mail to
- <xemacs-nt-request@xemacs.org> to subscribe.
-
- 2. Due to the long development cycle in between releases, it has been
- decided that intermediate versions will be made available in
- source only form for the truly interested.
-
- XEmacs 19.16 was the last 19 release, basically consisting of
- 19.15 plus the collected bugfixes.
-
- 3. As of December 1996, Steve Baur <steve@altair.xemacs.org> has
- become the lead maintainer of XEmacs.
-
-
-